﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;
using BeatEmUp.Enums;

namespace BeatEmUp.Items
{
    [Serializable]
    class Item
    {
        protected string name;
        protected int level;
        protected int levelWeight;
        protected int itemValue;
        protected Texture2D texture;
        protected Vector2 position;
        WeaponLocation location;
        public Item(string name, Texture2D texture,int level,Vector2 position,WeaponLocation location)
        {
            this.name = name;
            this.texture = texture;
            this.level = level;
            this.position = position;
            this.location = location;
            this.itemValue = 0;
            this.levelWeight = 2;
        }

        protected void CalculateValue(float additionalValue)
        {
            itemValue += (int)((Math.Pow(level,1.6)*levelWeight) + additionalValue);
        }

        protected Rectangle Bounds
        {
            get
            {
                return new Rectangle((int)position.X, (int)position.Y, texture.Width, texture.Height);
            }
        }

        public int Value
        {
            get
            {
                return itemValue;
            }
        }
    }
}
